#pragma once

#include <windows.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include "Physics.h"
#include "Common.h"

class CDrawList;
class CBrick;
class CModel;
class CRenderer;
class CTexture;

class CLevel
{
public:
	CLevel(CPhysics* pPhysics, CDrawList* pDrawList);
	~CLevel(void);

	int Draw();
	int Update();
	void LoadTextures();
	int LoadLevel(const char* szFileName);

	static void SetRenderer(CRenderer* pRenderer);

	void SetupMatrices(double3 d3Position);
	void SetTransform(double dMatrix[15], double3 d3Position);

	dGeomID geomWalls[4];

	//getters
	float GetLength() { return m_fLength; }
	float GetWidth() { return m_fWidth; }

private:
	float m_fLength;	//size from top to bottom
	float m_fWidth;		//size from left to right
	float m_fAngle;		//angle of water displacement;

	CModel* m_pLeftWallModel;
	CModel* m_pRightWallModel;
	CModel* m_pBackWallModel;
	CModel* m_pFloorModel;
	CModel* m_pWaterModel;

	CPhysics* m_pPhysics;
	CDrawList* m_pDrawList;

	SMaterial m_matFloor;
	SMaterial m_matWall;
	SMaterial m_matWater;

	//thickness of floor and walls
	double m_dFloorThick;
	double m_dWallThick;
	double m_dWallHeight;

	//size of texture image on floor and walls
	double m_dFloorTexScale;
	double m_dWallTexScale;

	static CRenderer* m_pRenderer;

	//textures
	CTexture* m_pTexBumpFloor;
	CTexture* m_pTexBumpWall;
	CTexture* m_pTexBumpWater;
};
